package com.housekeeping.housekeeping.wxPay.service.impl;

import com.housekeeping.housekeeping.serviceItem.utils.IDworkUtils;
import com.housekeeping.housekeeping.wxPay.dao.PayDao;
import com.housekeeping.housekeeping.wxPay.dao.impl.PayDaoImpl;
import com.housekeeping.housekeeping.wxPay.service.PayService;

import java.sql.SQLException;

public class PayServiceImpl implements PayService {
    private PayDao dao=new PayDaoImpl();
    @Override
    public Long creatWXPayOrder(String aid,int money) throws SQLException {
        Long oid=IDworkUtils.createOrder();
        int res=dao.creatWXPayOrder(aid,oid,money);
        if (res==1){
            return oid;
        }
        return null;
    }

    @Override
    public int updateStatus(Long orderId, int status) throws SQLException {
       return dao.updateStatus(orderId,status);
    }
}
